/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package 解析.node.node;

import 解析.node.others.TreeInfo;
import 解析.Matcher;

/**
 *
 * @author yanxi
 */
public class GroupRef extends Node { 
    public GroupHead head;

    GroupRef(GroupHead head) {
        this.head = head;  
    }
    
    @Override
    public boolean match(Matcher matcher, int i, CharSequence seq) {
        return head.matchRef(matcher, i, seq)
                && next.match(matcher, matcher.last, seq);
    }

    @Override
    public boolean study(TreeInfo info) {
        info.maxValid = false;
        info.deterministic = false;
        return next.study(info);
    } 
    
    @Override
    public String toString(){
        return "["+this.getClass().getName()+"]head.localIndex:"+head.localIndex;
    }
}
